//
//  Direction.h
//  Dungeons and Princesses
//
//  Created by John Grange on 10/17/11.
//  Copyright (c) 2011 SD Networks. All rights reserved.
//

#ifndef Dungeons_and_Princesses_Direction_h
#define Dungeons_and_Princesses_Direction_h

#include <ostream>
#include <istream>
#include <string.h>
#include <stdlib.h>
#include "Base.h"
#include "Door.h"


using std::string;
using std::ostream;
using std::istream;

class Direction: public Base
{
    
private:
    string directionName;   //this should contain North, South, East, West
    string nextRoomID;      //this should contain the roomID of the next room
    Door doorObject;
    bool hasDoor;

public:
    Direction(string direction): Base("Direction") {
        
        hasDoor = false;
        directionName = direction;
    }
    
    Direction(): Base("Direction") 
    {
        hasDoor = false;
    
    }
    
    void setDesc(std::string desc) {
        
        Base::setDesc(desc);
        
    }
    
    void setNextRoomID(std::string nextRoom) {
        
        nextRoomID = nextRoom;
        
    }
    
    std::string getRoomID() {
     
        return nextRoomID;
        
    }
    void setDoor(Door doorForDirection) {
        
        if (nextRoomID == "") {             // protect against setting door object if there is no room object in this direction (this makes no sense!
            std::cout << "Error: no room set!" << std::endl;
        }
        else {
            doorObject = doorForDirection;
            hasDoor = true;
        }
    }
    
    void setDirectionName(std::string direction) {
            
        directionName = direction;
        
    }
    
    Door getDoor() {
        
        return doorObject;
    }
    
    bool getHasDoor() {
        
        return hasDoor;
    }
    
    ~Direction(){};
    
protected:

};

#endif 


